package HOPACH;

import java.util.LinkedList;

public class Cluster implements Comparable<Cluster>{

	public Cluster(){
		childCluster= new LinkedList<Cluster>();
		members= new LinkedList<Integer>();
	}
	
	public int medoid;
	public LinkedList<Cluster> childCluster;
	public LinkedList<Integer> members;
	public Cluster parentCluster;
	
	public float distanceToNextParent=0;
	public float averageSilhouette=-2;
	
	public static int ShowStatus=0;
	
	public String toString() { // Always good for debugging
		if(members!=null){
			if(ShowStatus==0)
				return members.size()+"";
			else
			return ((float)Math.round(averageSilhouette*100))/100.0f+"";
		}
		return "";
	}

	@Override
	public int compareTo(Cluster o) {
		if(o.distanceToNextParent>this.distanceToNextParent)
			return-1;
		else if(o.distanceToNextParent==this.distanceToNextParent)
				return 0;
		else return 1;		
	}
	
	
}
